package easyjava.qixi.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Table(name="invitation")
@Entity
public class Invitation {
	 @Id
	 @Column(name="id")
     private int id;
	 
     @Column(name="invite_time",insertable=false)
     private Date inviteTime;
     
     @Column(name="is_accepted")
     private String isAccepted;
     
     @ManyToOne
     @JoinColumn(name="inviter_user_id")
     private User user;
     @ManyToOne
     @JoinColumn(name="invitee_user_id")
     private User users;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Date getInviteTime() {
		return inviteTime;
	}
	public void setInviteTime(Date inviteTime) {
		this.inviteTime = inviteTime;
	}
	public String getIsAccepted() {
		return isAccepted;
	}
	public void setIsAccepted(String isAccepted) {
		this.isAccepted = isAccepted;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public User getUsers() {
		return users;
	}
	public void setUsers(User users) {
		this.users = users;
	}
	@Override
	public String toString() {
		return "Invitation [id=" + id + ", inviteTime=" + inviteTime + ", isAccepted=" + isAccepted + ", inviterId=" + user.getId()
				+ ", inviteeId=" + users.getId() + "]";
	}
     
}
